<?php if (isset($categories)): ?>
<div class="row-fluid">
    <div class="span12">
        <table cellpadding="0" cellspacing="0" border="0" class="responsive dynamicTable display table table-bordered" width="100%">
            <thead>
                <tr>
                    <th>
                        <span>Tên</span>
                    </th>
                     <th>
                        <span>Danh mục cha</span>
                    </th>
                    <th>
                        <span>Danh mục con</span>
                    </th>
                    <th>
                        <span>Danh sách sản phẩm</span>
                    </th>
                    <th>
                        <span>Thao tác</span>
                    </th>
                </tr>
            </thead>
            <tbody>
              	<?php foreach ($categories as $category): ?>
                <tr>
                    <td style="text-align:center"><?php echo $category['name'] ?></td>
            		<td style="text-align:center"><?php echo $category['parent_name'] ?></td>
                    <td style="text-align:center"><a href="<?php echo url_for('@category_list?parent_id='.$category['id']) ?>">Xem</a></td>
                    <td style="text-align:center"><a href="<?php echo url_for('@product_list?category_id='.$category['id']) ?>">Xem</a></td>
                    <td style="text-align:center"><a href="<?php echo url_for('@category_edit?category_id='.$category['id']) ?>"><span class="icon12 icomoon-icon-pencil"></span></a><a href="<?php echo url_for('@category_delete?category_id='.$category['id']) ?>"><span class="icon12 icomoon-icon-remove"></span></a></td>
                </tr>
                <?php endforeach ?>
            </tbody>
        </table>
	</div>
</div>
<?php endif ?>